import os.path
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 准备配置项
options = webdriver.ChromeOptions()

# 准备下载路径
download = os.path.dirname(os.path.abspath((__file__))) + '\download'
prefs = {
    'profile.default_content_settings.popups': 0,
    'download.default_directory': download
}
options.add_experimental_option('prefs', prefs)

# 打开浏览器(设置options),请求网址
driver = webdriver.Chrome(options=options)
driver.get('https://www.selenium.dev/downloads/')

# 下载文件
# 定位文件,执行click操作
driver.find_element(By.LINK_TEXT, '64 bit Windows IE').click()
